package com.dd.common.dto.system.dept;

import com.dd.common.pojo.dto.group.CreateGroup;
import com.dd.common.pojo.dto.group.UpdateGroup;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * @author cheng
 */
@Schema(description = "部门DTO")
@Data
public class SysDeptDTO implements java.io.Serializable {
    @Null(message = "ID必须为空", groups = CreateGroup.class)
    @NotNull(message = "ID不能为空", groups = UpdateGroup.class)
    @Schema(description = "部门ID", example = "1")
    @Min(value = 1, message = "ID必须是正整数")
    private Long id;

    @NotBlank(message = "部门名称不能为空", groups = CreateGroup.class)
    @Schema(description = "部门名称", example = "开发部")
    private String deptName;

    @Schema(description = "排序", example = "1")
    @Range(min = 0, message = "排序值只能是正整数")
    private Integer sort;

    @Schema(description = "状态：1-正常，0-禁用", example = "1")
    @Range(min = 0, max = 1, message = "状态值只能是0或1")
    private Integer status;
}
